﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ClassLibrary.Data;
using System.Data;

namespace ClassLibrary.DAO
{
    public class TblMenuDAO
    {
         private DBService _db = null;
         public TblMenuDAO(string ConnectionString)
         {
            _db = new DBService(ConnectionString);
         }

         public DataTable GetAll()
         {
             DataTable dt = new DataTable();
             try
             {
                 dt = _db.ExeSP_DataTable("sp_GetMenuParent", false, CommandType.Text);
             }
             catch (Exception ex)
             {
                 throw ex;
             }
             return dt;
         }

         public DataTable GetAll_Admin()
         {
             DataTable dt = new DataTable();
             try
             {
                 dt = _db.ExeSP_DataTable("select * from TblMenu", false, CommandType.Text);
             }
             catch (Exception ex)
             {
                 throw ex;
             }
             return dt;
         }
    }
}
